﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Areas/SystemManage/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        $("#Account").val($.request('account'));
        $("#RealName").val($.request('realName'));
    });
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        if ($("#OldUserPassword").val() == $("#UserPassword").val()) { 
            $.modalMsg("新密码不能和原密码一样");
            return false;
        }
        var postData = $("#form1").formSerialize();
        postData["userPassword"] = $("#UserPassword").val();
        postData["oldUserPassword"] = $("#OldUserPassword").val();
        postData["keyValue"] = keyValue;
        $.submitForm({
            url: "/SystemManage/Manager/SubmitRevisePassword",
            param: postData,
            success: function () {
                $.loading(false)
            }
        })
    }
</script>
<form id="form1">
    <div style="padding-top: 30px; margin-right: 40px;">
        <table class="form">
            <tr>
                <th class="formTitle">账户</th>
                <td class="formValue">
                    <input id="Account" name="Account" readonly type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">姓名</th>
                <td class="formValue">
                    <input id="RealName" name="RealName" readonly type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">原密码</th>
                <td class="formValue">
                    <input id="OldUserPassword" name="OldUserPassword" type="password" class="form-control required" placeholder="请输入新密码" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">新密码</th>
                <td class="formValue">
                    <input id="UserPassword" name="UserPassword" type="password" class="form-control required" placeholder="请输入新密码" />
                </td>
            </tr>
        </table>
    </div>
</form>
